/**
 *@module project
 *@name engineeringSupervisionPage
 *@desc 项目管理主页面
 *@author YuXueYing
 *@date 2019-09-09 16:52:27
 */
Ext.define('js.foundation.foundationAPageMain', {
    extend: 'Ext.panel.Panel',
    scrollable : true,
    id:'js.foundation.foundationAPageMain',
    requires: ['js.Util', 'js.ctrl.Common'],
    bodyStyle: "background-color:#eee;",
    config: {
        border: false,
        layout: {
            type: 'vbox',
            align: 'stretch'
        }
    },
    initComponent: function () {
        let params={
            floor_thickness:this.floor_thickness,
            indoor_space_size:this.indoor_space_size,
            engineering_id:this.engineering_id,
            status:this.status,
            PageName:this.PageName,
            storeAll:this.storeAll,
            engineering_no:this.engineering_no,
            engineering_name:this.engineering_name,
            //结构实体混凝土强度
            structural_solid_concrete_strength:this.structural_solid_concrete_strength,
            //钢筋位置、数量、保护层厚度
            reinforcement_data:this.reinforcement_data,
            //切体砂浆强度
            masonry_mortar_strength:this.masonry_mortar_strength,
            //植筋锚固力
            planting_anchor:this.planting_anchor,
            //地基验槽(所属重要分部验收
            foundation_inspection:this.foundation_inspection,
            //地基基础分部
            foundation_based_division:this.foundation_based_division,
            //主体分部
            main_division:this.main_division,
        };
        let information = Ext.create('Ext.Component',
            {
                id:'informationA',
                html:'<div style="height:36px;background:#fff;box-shadow: #666 0px 0px 10px;">' +
                '<div style="float: left" id="EngineeringSupervision">' +
                '<div style="width:100%;font-size: 14px;margin-top: 11px;margin-left:30%;display:inline-block; color: #000;"><span>工程管理</span></div>' +
                '</div>' +
                '<div style="float: left">' +
                '<div style="width:100%;font-size: 14px;margin-top: 11px;margin-left:478%;display:inline-block; color: #000;"><span>></span></div>' +
                '</div>' +
                '<div style="float: left" id="gcjd">' +
                '<div style="width:100%;font-size: 14px;margin-top: 11px;margin-left:50;display:inline-block; color: #000;"><span id="titlename">工程进度验收节点</span></div>' +
                '</div>' +
                '<div style="float: left">' +
                '<div style="width:100%;font-size: 14px;margin-top: 11px;margin-left:270%;display:inline-block; color: #000;"><span>></span></div>' +
                '</div>' +
                '<div style="float: left">' +
                '<div style="width:100%;font-size: 14px;margin-top: 11px;margin-left:35;display:inline-block; color: #000;"><span id="titlename">'+this.titleName+' </span></div>' +
                '</div>' +
                '</div>'
            });
        let informationNameComponent={
            xtype: 'panel',
            margin: '20 0 0 30',
            bodyStyle: "background-color:#eee;",
            items:[{
                xtype:'panel',
                margin: '24 100% -10 30',
                html: '<span id="enterprise_nameA" style="font-size: 20px;font-weight: bold; width:"80%";display:inline-block;font-family: 方正兰亭黑;color:#000">'+this.engineering_no+' ----- '+this.engineering_name+'</span>'

            },{
                xtype : "button",
                height:'40',
                cls:'buttonAA',
                id:'enterprise_nameA',
                handler: this.fanhui,
                engineering_no:this.engineering_no,
                engineering_name:this.engineering_name,
                engineering_id:this.engineering_id,
                width: '100',
                text:'返回'
            }]
        };
        /*        let titleAddPage= Ext.create('js.foundation.TitleAddPanel', params);*/
        let engineeringSupervisionShowPage = Ext.create(this.FoundationShowBg, params);
        this.items = [information,informationNameComponent,/*titleAddPage*/engineeringSupervisionShowPage];
        this.callParent(arguments);
        this.on('afterrender',this.goBack);

    },
    goBack:function () {
//点击工程管理删除两个地基检验 以及工程进度验收节点
        Ext.get("EngineeringSupervision").on("click",function(){
            util.sysPanelAdd('js.project.engineeringSupervisionPage');
            let removelist = ['js.information.InformationListMain','js.foundation.foundationPageMain'];
            for(let i in removelist){
                let cmp = Ext.getCmp(removelist[i]);
                if (cmp) cmp.close();
                if (cmp) cmp.remove(cmp)
            }
        });
        let engineering_id=this.engineering_id;
        let engineering_no=this.engineering_no;
        let engineering_name=this.engineering_name;
        Ext.get("gcjd").on("click",function(){
            let newPanel=Ext.getCmp('js.information.InformationListMain');
            if(newPanel){
                newPanel.close();
            }

            util.sysPanelAdd('js.information.InformationListMain',{
                engineering_id:engineering_id,
                engineering_no:engineering_no,
                num:1,
                engineering_name:engineering_name
            });
            let removelist = ['js.foundation.foundationPageMain'];
            for(let i in removelist){
                let cmp = Ext.getCmp(removelist[i]);
                if (cmp) cmp.close();
                if (cmp) cmp.remove(cmp)
            }
        });


    },
    fanhui:function (btn) {
        let newPanel=Ext.getCmp('js.information.InformationListMain');
        if(newPanel){
            newPanel.close();
        }
        let engineering_id=btn.engineering_id;
        let engineering_no=btn.engineering_no;
        let engineering_name=btn.engineering_name;
        util.sysPanelAdd('js.information.InformationListMain',{
            engineering_id:engineering_id,
            engineering_no:engineering_no,
            num:1,
            engineering_name:engineering_name
        });
        let removelist = ['js.foundation.foundationPageMain'];
        for(let i in removelist){
            let cmp = Ext.getCmp(removelist[i]);
            if (cmp) cmp.close();
            if (cmp) cmp.remove(cmp)
        }
    }
});